package com.future.controller;

import com.future.common.annotation.ControllerMapping;
import com.future.common.annotation.NoNeedLogin;
import com.future.common.base.BaseController;
import com.future.dao.XjyDao;
import com.jfinal.aop.Inject;
import com.jfinal.plugin.activerecord.Db;
/**
 * 巡检员
 * @author ThinkPad
 *
 */
@ControllerMapping("/xjy")
public class XjyController extends BaseController {
	@Inject
	private XjyDao xjyDao;
	@NoNeedLogin
	public void getXjy(){
		renderResult("xjy", this.xjyDao.findAllXjy()); 
	}
	@NoNeedLogin
	public void editXjy(String xjryid, String name, String phone){
		this.xjyDao.findById(xjryid).setName(name).setPhone(phone).update();
		renderSuccess();
	}
	
	@NoNeedLogin
	public void deleteByPhone(String phone){
		Db.delete("delete from xjy where phone = ?", phone);
		renderSuccess();
	}
}
